print(rbinom(n=1,size = 10,prob = .4))
print(rbinom(n=1,size = 1,prob = .4))
print(rbinom(n=10,size = 1,prob = .4))
binomData <- data.frame(Successes=rbinom(n=10000,size=10,prob =.234324))
print(ggplot(binomData,aes(x=Successes)) + geom_histogram(binwidth=1))

binom5 <- data.frame(Successes=rbinom(n=10000,size=5,prob = .3),size=5)
print(dim(binom5))
print(head(binom5))
binom10 <- data.frame(Successes=rbinom(n=10000,size=10,prob=.3),size=10)
print(head(binom10))
binom100 <- data.frame(Successes=rbinom(n=10000,size=100,prob=.3),size=100)
print(head(binom100))
binom1000 <- data.frame(Successes=rbinom(n=10000,size=1000,prob=.3),size=1000)
print(head(binom1000))
binomAll <- rbind(binom5,binom10,binom100,binom1000)
print(dim(binomAll))
print(head(binomAll,10))
print(tail(binomAll,10))
print(ggplot(binomAll,aes(x=Successes)) + geom_histogram() + facet_wrap(~ size,scales = "free"))
print(dbinom(x=3,size=10,prob=.3))
print(pbinom(q=3,size=10,prob=.3))
print(dbinom(x=1:10,size = 10,prob =.3))
print(pbinom(q=1:10,size = 10,prob =.3))
print(qbinom(p=.3,size = 10,prob = .3))
print(qbinom(p=c(.3,.35,.4,.5,.6),size=10,prob=.3))